﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Qy.Scenario;

[SugarTable(DbTableName.CmsContent)]
public class Content
{
    [SugarColumn(IsPrimaryKey = true)]
    public int Id { get; set; }
    public int Cid { get; set; }
    public string Title { get; set; }
    public string Attments { get; set; }
    public string Examine { get; set; }
    public string Img { get; set; }
    public int Imgbl { get; set; }
    public DateTime Time { get; set; }
    public int Hits { get; set; }
    public int Uid { get; set; }
    public bool Status { get; set; }
    public bool AttA { get; set; }
    public bool AttB { get; set; }
    public bool AttC { get; set; }
}

public class EditContentAndContent
{
    public int Id { get; set; }
    [Display(Name = "栏目")]
    [Required(ErrorMessage = "请选择栏目")]
    public int Cid { get; set; }
    [Display(Name = "标题")]
    [Required(ErrorMessage = "标题未填写")]
    public string Title { get; set; }
    public string Attments { get; set; }
    [Display(Name = "作者")]
    [Required(ErrorMessage = "作者未填写")]
    public string Examine { get; set; }
    [Display(Name = "缩略图")]
    public string Img { get; set; }
    public DateTime Time { get; set; } = DateTime.Now;
    [Display(Name = "显示状态")]
    [Required(ErrorMessage = "选择内容显示状态")]
    public bool Status { get; set; }
    [Display(Name = "头条")]
    public bool AttA { get; set; }
    [Display(Name = "小头条")]
    public bool AttB { get; set; }
    [Display(Name = "轮换")]
    public bool AttC { get; set; }

    [Display(Name = "内容")]
    [Required(ErrorMessage = "内容未填写")]
    public string Content { get; set; }
}

public class ViewContentAndContent
{
    public int Id { get; set; }
    public int Cid { get; set; }
    public string Title { get; set; }
    public string Attments { get; set; }
    public string Img { get; set; }
    public string Examine { get; set; }
    public int Hits { get; set; }
    public DateTime Time { get; set; }
    public int Aid { get; set; }
    public string Content { get; set; }
    public string NickName { get; set; }
    public string DeptName { get; set; }

}

/// <summary>
/// 切换内容属性状态
/// </summary>
public class ContentFormChange
{
    public string Title { get; set; }
    public string Name { get; set; }
    public int Id { get; set; }
    public bool Val { get; set; }
}

public class ContentQuery : PagerInfo
{
    public int[] Cids { get; set; } = null;
    public int Limit { get; set; } = 15;
    public string CacheName { get; set; } = null;
    public int? CacheTime { get; set; }
    /// <summary>
    /// 内容属性 1 头条，2小头条，3轮换图
    /// </summary>
    public int Att { get; set; }
    public bool ImgBl { get; set; }
    public string Orderby { get; set; }
    public bool Status { get; set; }
    public int Uid { get; set; }
    public string Title { get; set; }
    public List<int> Uids { get; set; }
    public string KeyWord { get; set; }
}

/// <summary>
/// 查询统计
/// </summary>
public class ContentCount
{
    public string Name { get; set; }
    public int Value { get; set; }
    public int Status { get; set; }
    public int Uids { get; set; }
}



